import sys

for line in sys.stdin:
    line = line.strip()
    date = line[15:23]
    temperature = line[87:92]
    if int(temperature) != 9999:
        print('%s\t%d' % (date, int(temperature)))
